<?php

class Komentar{

	var $db;

	public function __construct(){
		$this->db = new DBClass();
	}	

	public function get_all_comment(){

		$query = "SELECT * FROM komentar k";
		$rows = $this->db->getRows($query);
		return $rows;
	}

	/*public function comment(){

		$query = "INSERT INTO komentar SET email nama_komentator isi_komentar post_id_post";
		$rows = $this->db->putRows($query);
		header('Location: komentar.php');
	}*/

	public function deleteKomentar($data){
		
		$query ="DELETE FROM komentar WHERE id_komentar='".@$data."'";
		$rows = $this->db->putRows($query);
		header('Location: komentar.php');
	}
}
?>